<template>
  <div class="meeting">
    <div class="wrap">

      <Form ref="meetingForm" :model="meetingForm" :rules="loginRules" class="mt20" :labelWidth="100">
        <FormItem label="创建名称:" prop="name" required>
          <Input type="text" v-model="meetingForm.name" placeholder="请输入名称"></Input>
        </FormItem>
        <FormItem label="开始时间:" prop="password" required>
          <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" style="width:300px;" placeholder="请选择时间"></DatePicker>
        </FormItem>
        <FormItem label="结束时间:" prop="password">
          <DatePicker type="datetime" format="yyyy-MM-dd HH:mm"  style="width:300px;" placeholder="请选择时间"></DatePicker>
        </FormItem>
        <FormItem label="是否录制:" prop="password">
          <RadioGroup v-model="meetingForm.isRecord">
            <Radio label="1">是</Radio>
            <Radio label="0">否</Radio>
          </RadioGroup>
        </FormItem>
        <FormItem label="清晰度:" prop="password">
          <RadioGroup v-model="meetingForm.isHd">
            <Radio label="1">1080P</Radio>
            <Radio label="2">720P</Radio>
            <Radio label="3">480P</Radio>
          </RadioGroup>
        </FormItem>
        <FormItem label="已邀请:" prop="password">
          <span class="c2">7</span>人
          <Tag @click.native="addMember">邀请成员</Tag>
          &nbsp;&nbsp;&nbsp;&nbsp;
          <Checkbox v-model="isOpen" v-if="$route.query.type==3">公开</Checkbox>
        </FormItem>
        <!-- <FormItem label="主持人:" prop="password">
          <Input placeholder="自动读取创建人"></Input>
        </FormItem> -->
        <FormItem :label="labels[$route.query.type]" prop="password">
          <Input type="textarea"></Input>
        </FormItem>

        <FormItem>
          <Button type="primary" :loading="loading" @click="handleSubmit('meetingForm')" long>确认创建</Button>
        </FormItem>
      </Form>
    </div>

    <Modal v-model="modal1" width="700" title="邀请成员">
      <div>
        <BsSelectPerson />
      </div>
      <div slot="footer" class="text-center">
        <Button type="primary" size="large">确认邀请</Button>
      </div>
    </Modal>
  </div>
</template>

<script>
import BsSelectPerson from '@/components/BsSelectPerson'

  export default {
    components:{BsSelectPerson},
    data() {
      return {
        meetingForm: {
          name: '',
          startTime: '',
          endTime: '',
          isRecord: '1',
          isHd: '2'
        },
        isOpen: false,
        loading: false,
        loginRules: {},
        modal1: false,
        position:[
          {title: '我的会议', link: '/admin/myCreated'},
          {title: '创建会议'},
        ],
        labels: [
          '',
          '会议介绍:',
          '培训介绍:',
          '直播介绍:'
        ]
      }
    },
    mounted () {
      this.$store.commit('UPDATE_POSITION', this.position)
      this.$store.commit('SHOW_SHOWBACK')
    },
    methods: {
      addMember() {
        this.modal1 = true
      },
      handleSubmit (){

      }
    }
  }
</script>

<style lang="less" scoped>
  .wrap {
    width: 400px;
  }
</style>
